﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SinglePageByDefault.aspx.cs" ValidateRequest="false"
    Inherits="Admin_ContentManage_SinglePageByDefault" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>單頁帶欄目編輯</title>
    <link href="../css/common.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="../../ueditor/themes/default/ueditor.css" />
    <script type="text/javascript" charset="utf-8">
    window.UEDITOR_HOME_URL ="../ueditor";
    function showEdit(){
     var editor = new UE.ui.Editor();
    editor.render('txtContent');

    }
    </script>

    <script src="../../ueditor/editor_config.js" type="text/javascript"></script>

    <script src="../../ueditor/editor.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="17" valign="top" style="background: url(../images/mail_leftbg.gif)">
                <img src="../images/left-top-right.gif" width="17" height="29" />
            </td>
            <td valign="top" style="background: url(../images/content-bg.gif)">
                <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" id="table2">
                    <tr>
                        <td height="31">
                            <div class="titlebt">
                                <asp:Label ID="labTitle" runat="server" Text=""></asp:Label>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="16" valign="top " style="background: url(../images/mail_rightbg.gif)">
                <img src="../images/nav-right-bg.gif" width="16" height="29" />
            </td>
        </tr>
        <tr>
            <td valign="middle" style="background: url(../images/mail_leftbg.gif)">
                &nbsp;
            </td>
            <td valign="top" bgcolor="#F7F8F9">
                <div class="topnav">
                    <ul id="topnavbar">
                        <li class="topmenu">
                            <asp:LinkButton ID="lbnEditNode" class="top_link" runat="server" OnClick="lbnEditNode_Click">
                             <span>編輯欄目內容</span>
                            </asp:LinkButton>
                        </li>
                        <li class="topmenu">
                            <asp:LinkButton ID="lbnEditContent" class="top_link" runat="server" OnClick="lbnEditContent_Click">
                             <span>編輯頁面內容</span>
                            </asp:LinkButton>
                        </li>
                                                <li class="topmenu">
                            <asp:LinkButton ID="lbnDefaultAdd" class="top_link" runat="server" onclick="lbnDefaultAdd_Click" >
                             <span>添加首頁展示</span>
                            </asp:LinkButton>
                        </li>
                    </ul>
                    <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                        <asp:View ID="View1" runat="server">
                            <table class="listtable" cellspacing="0" cellpadding="0" border="0" style="width: 100%;
                                border-collapse: collapse;">
                                <asp:Repeater ID="repNodeList" runat="server">
                                    <HeaderTemplate>
                                        <tr>
                                            <th scope="col" style="width: 110px;">
                                                欄目名稱
                                            </th>
                                            <th scope="col" width="100px">
                                                為頻道
                                            </th>
                                            <th scope="col" width="250px">
                                                欄目採用模板
                                            </th>
                                            <th scope="col" width="250px">
                                                欄目簡介
                                            </th>
                                            <th scope="col" style="width: 200px;">
                                                操作
                                            </th>
                                        </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr style="text-align: center" onmouseover="this.style.backgroundColor='F3F7FF'"
                                            onmouseout="this.style.backgroundColor='FFFFFF'">
                                            <td>
                                                <%#Eval("NodeName")%>
                                            </td>
                                            <td>
                                                <%#Eval("IsHeard")%>
                                            </td>
                                            <td>
                                                <%#Eval("Template")%>
                                            </td>
                                            <td>
                                                <%#Eval("MateMark")%>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="LinkButton1" PostBackUrl='<%#getUrl(Eval("ModelType"), Eval("Id")) %>'
                                                    runat="server">編輯</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </asp:View>
                        <asp:View ID="View2" runat="server">
                            <table class="formtable" with="100%">
                                <tbody>
                                    <tr>
                                        <th>
                                            <asp:Button ID="btnSaveTemplate" runat="server" class="btnsubmit" Text="保存" CommandArgument="0"
                                                OnClick="btnSaveTemplate_Click"  />
                                        </th>
                                        <td>
                                            頁面編輯
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            上傳圖片
                                        </th>
                                        <td>
                                            <asp:FileUpload ID="fuImage" runat="server" />
                                            &nbsp;<asp:HiddenField ID="hfImage" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            頁面內容
                                        </th>
                                        <td>
                                            <input type="button" onclick="showEdit()" class="btnsubmit" value="啟用編輯器" />
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <asp:TextBox ID="txtContent" runat="server" Height="800px" TextMode="MultiLine" Width="100%">
                               
                                            </asp:TextBox>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </asp:View>
                          <asp:View ID="View3" runat="server">
                                          <table cellspacing="0" cellpadding="0" width="100%" class="maintable">
                    <tbody>
                        <tr>
                            <th>
                                添加新的信息
                            </th>
                            <td align="left">
                                <asp:Button runat="server" ID="btnAddDictionary" Text="添加" class="btnsubmit" 
                                    onclick="btnAddDictionary_Click"  />
                            </td>
                        </tr>
                    </tbody>
                </table>
                            <table class="listtable" cellspacing="0" cellpadding="0" border="0" style="width: 100%;
                                border-collapse: collapse;">
                                <asp:Repeater ID="repDictionaryList" runat="server" OnItemCommand="repDictionaryList_ItemCommand">
                                    <HeaderTemplate>
                                        <tr>
                                            <th scope="col" style="width: 80px;">
                                               信息編號
                                            </th>
                                            <th scope="col" style="width: 110px;">
                                                信息名稱
                                            </th>
                                            <th scope="col" style="width: auto">
                                                信息值
                                            </th>
                                            <th scope="col" style="width: 200px;">
                                                操作
                                            </th>
                                        </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr style="text-align: center" onmouseover="this.style.backgroundColor='F3F7FF'"
                                            onmouseout="this.style.backgroundColor='FFFFFF'">
                                            <td>
                                                <%#Eval("Id")%>
                                            </td>
                                            <td>
                                                <%#Eval("Name")%>
                                            </td>
                                            <td>
                                                <%#Eval("Values")%>
                                            </td>
                                            <td>
                                                <asp:Button ID="Button2" class="btnsubmit" CommandArgument='<%#Eval("Id")%>' CommandName="edit"
                                                    runat="server" Text="更新" />
                                                &nbsp;
                                                <asp:Button ID="Button1" class="btncancel" CommandArgument='<%#Eval("Id")%>' CommandName="delete"
                                                    runat="server" Text="刪除" />
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </asp:View>
                        <asp:View ID="View4" runat="server">
                            <table class="formtable" with="100%">
                                <tbody>
                                    <tr>
                                        <th>
                                            <asp:Button ID="btnSaveClass" runat="server" class="btnsubmit" Text="保存" CommandArgument="0"
                                                OnClick="btnSaveClass_Click" />
                                        </th>
                                        <td>
                                            信息内容
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>
                                            信息名稱：
                                        </th>
                                        <td>
                                            <asp:TextBox ID="txtClassName" runat="server" Width="400px"></asp:TextBox>&nbsp;<span
                                                style="width: 200px;" title="">請輸入信息</span>
                                        </td>
                                    </tr>
                                    <asp:Panel ID="Panel1" runat="server">
                                        <tr>
                                            <th>
                                                封面圖片：
                                            </th>
                                            <td>
                                                <asp:FileUpload ID="fuImagePath" runat="server" />
                                                <br />
                                                <asp:Label ID="labImagePath" runat="server" Text="" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>
                                                信息值：
                                            </th>
                                            <td>
                                                <asp:ScriptManager ID="ScriptManager1" runat="server">
                                                </asp:ScriptManager>
                                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                    <Triggers>
                                                        <asp:PostBackTrigger ControlID="ddlType" />
                                                    </Triggers>
                                                    <ContentTemplate>
                                                        <asp:DropDownList ID="ddlType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
                                                            <asp:ListItem Value="" Text="請輸入相關信息" />
                                                            <asp:ListItem Value="file" Text="上載文件" />
                                                            <asp:ListItem Value="http" Text="鏈接地址" />
                                                        </asp:DropDownList>
                                                        <asp:TextBox Visible="false" ID="txtValues" runat="server" Width="280px"></asp:TextBox>
                                                        <asp:FileUpload Visible="false" ID="fuDictionaryFile" runat="server" />
                                                    </ContentTemplate>
                                                </asp:UpdatePanel>
                                            </td>
                                        </tr>
                                    </asp:Panel>
                                </tbody>
                            </table>
                        </asp:View>
                    </asp:MultiView>
                </div>
            </td>
            <td style="background: url(../images/mail_rightbg.gif)">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td valign="bottom" style="background: url(../images/mail_leftbg.gif)">
                <img src="../images/buttom_left2.gif" width="17" height="17" />
            </td>
            <td style="background: url(../images/buttom_bgs.gif)">
                <img src="../images/buttom_bgs.gif" width="17" height="17">
            </td>
            <td valign="bottom" style="background: url(../images/mail_rightbg.gif)">
                <img src="../images/buttom_right2.gif" width="16" height="17" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
